package com.tuzhi.filestore.fileback;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class FileBackupsScheduled {


    @Autowired
    FileBackupsServiceImpl fileBackupsService;

    @Scheduled(cron = "0 59 23 * * ?")
    public void task() {
        log.info("开始-执行备份文件任务");
        log.info("先请空前面的备份");
        fileBackupsService.clearBackDir();
        log.info("开始备份------");
        fileBackupsService.backFile();

//        fileBackupsService.clearTimeLimitFile();

        log.info("任务结束===============");
    }

}
